package org.demo.pattern.prototype;
/**
 * 
 * @author  
 * @date    2011-5-20
 * @file    org.demo.pattern.prototype.Person.java
 */
public class Person implements Cloneable{
	
	public static enum SEX {MALE, FEMALE}
	
	private String name;
	private SEX gender;
	
	/**
	 * 构造函数
	 * @param name
	 * @param gender
	 */
	public Person(String name, SEX gender) {
		super();
		this.name = name;
		this.gender = gender;
	}
	
	@Override
	protected Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the gender
	 */
	public SEX getGender() {
		return gender;
	}
	/**
	 * @param gender the gender to set
	 */
	public void setGender(SEX gender) {
		this.gender = gender;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Person [gender=");
		builder.append(gender);
		builder.append(", name=");
		builder.append(name);
		builder.append("]");
		return builder.toString();
	}	
}
